class UserClass {
  firstName: string
  lastName: string
  fullName: string

  constructor (firstName, lastName) {
    this.firstName = firstName
    this.lastName = lastName
    this.fullName = firstName + lastName
  }
}

interface UserInterface {
  firstName: string,
  lastName: string
}

function newUser (name: UserInterface) {
  return 'Hello ' + name.firstName + name.lastName
}

const myName: UserInterface = new UserClass('Lao', 'zhaocheng')

console.log(newUser(myName))